package com.aaa.system.controller;

import com.aaa.core.entity.AclUser;
import com.aaa.core.entity.Results;
import com.aaa.security.annotation.RequiresPermissions;
import com.aaa.system.service.AclUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：ludi（206913808@qq.com）
 * @date ：Created in 2022/12/2 11:19
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/system/user")
public class AclUserController {
    @Autowired
    private AclUserService userService;

    @GetMapping("/getByName/{username}")
    public Results<AclUser> getName(@PathVariable String username){
        return userService.findByName(username);
    }

    @GetMapping("list")
    @RequiresPermissions(value="user:list")
    public String list(){
        System.out.println("~~~~~~~~~~用户查询~~~~~~~~~~~~~");
        return "用户查询";
    }

    @GetMapping("delete")
    @RequiresPermissions(value="user:delete")
    public String delete(){
        System.out.println("~~~~~~~~~~删除~~~~~~~~~~~~~");
        return "用户查询";
    }
}